#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int cmp_str(const void* a, const void* b)
{
    return strcmp(*(const char**)a, *(const char**)b);
}

int find_index(char** arr, int n, const char* s)
{
    int left = 0, right = n - 1;
    while (left <= right) {
        int mid = (left + right) / 2;
        int res = strcmp(arr[mid], s);
        if (res == 0) return mid;
        if (res < 0) left = mid + 1;
        else right = mid - 1;
    }
    return -1;
}

int main() 
{
    int n, m;
    scanf_s("%d %d", &n, &m);

    char** tempStrings = (char**)malloc(2 * m * sizeof(char*));
    for (int i = 0; i < 2 * m; i++) 
    {
        tempStrings[i] = (char*)malloc(11 * sizeof(char));
    }

    for (int i = 0; i < m; i++)
    {
        scanf_s("%s %s", tempStrings[2 * i], tempStrings[2 * i + 1]);
    }

    char** allStrings = (char**)malloc(2 * m * sizeof(char*));
    for (int i = 0; i < 2 * m; i++) 
    {
        allStrings[i] = tempStrings[i];
    }

    qsort(allStrings, 2 * m, sizeof(char*), cmp_str);

    char** allNames = (char**)malloc(n * sizeof(char*));
    int idx = 0;
    for (int i = 0; i < 2 * m; i++) {
        if (i == 0 || strcmp(allStrings[i], allStrings[i - 1]) != 0) 
        {
            if (idx < n)
            {
                allNames[idx++] = allStrings[i];
            }
        }
    }

    int* deg = (int*)calloc(n, sizeof(int));
    for (int i = 0; i < m; i++)
    {
        int idx_a = find_index(allNames, n, tempStrings[2 * i]);
        int idx_b = find_index(allNames, n, tempStrings[2 * i + 1]);
        if (idx_a != -1 && idx_b != -1) 
        {
            deg[idx_a]++;
            deg[idx_b]++;
        }
    }

    int** adj = (int**)malloc(n * sizeof(int*));
    for (int i = 0; i < n; i++) 
    {
        adj[i] = (int*)malloc(deg[i] * sizeof(int));
    }

    int* counters = (int*)calloc(n, sizeof(int));
    for (int i = 0; i < m; i++) 
    {
        int idx_a = find_index(allNames, n, tempStrings[2 * i]);
        int idx_b = find_index(allNames, n, tempStrings[2 * i + 1]);
        if (idx_a != -1 && idx_b != -1) 
        {
            adj[idx_a][counters[idx_a]++] = idx_b;
            adj[idx_b][counters[idx_b]++] = idx_a;
        }
    }

    long long* sum_deg_neighbors = (long long*)calloc(n, sizeof(long long));
    for (int i = 0; i < n; i++) 
    {
        for (int j = 0; j < deg[i]; j++) 
        {
            int neighbor = adj[i][j];
            sum_deg_neighbors[i] += deg[neighbor];
        }
    }

    int* is_sheniu = (int*)calloc(n, sizeof(int));
    int has_sheniu = 0;
    for (int i = 0; i < n; i++) 
    {
        if (deg[i] > 0 && (long long)deg[i] * deg[i] > sum_deg_neighbors[i]) 
        {
            is_sheniu[i] = 1;
            has_sheniu = 1;
        }
    }

    if (!has_sheniu) 
    {
        printf("None\n");
    }
    else {
        int first = 1;
        for (int i = 0; i < n; i++) 
        {
            if (is_sheniu[i])
            {
                if (!first) printf(" ");
                printf("%s", allNames[i]);
                first = 0;
            }
        }
        printf("\n");
    }

    for (int i = 0; i < 2 * m; i++)
    {
        free(tempStrings[i]);
    }
    free(tempStrings);
    free(allStrings);
    free(allNames);
    free(deg);
    for (int i = 0; i < n; i++) 
    {
        free(adj[i]);
    }
    free(adj);
    free(counters);
    free(sum_deg_neighbors);
    free(is_sheniu);

    return 0;
}